home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / RSTRCRT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  953 b   |  29 lines

  1. #include <graphics.h>
  2. #include <conio.h>
  3.  
  4. main()
  5. {
  6.   int errorcode;
  7.   int graphdriver = DETECT;
  8.   int graphmode;
  9.  
  10. /* Detect and initialize graphics system */
  11.   initgraph(&graphdriver, &graphmode, "c:\\turboc");
  12.  
  13.   settextjustify(CENTER_TEXT, CENTER_TEXT);
  14.   settextstyle(SANS_SERIF_FONT, HORIZ_DIR, 1);
  15.   outtextxy( getmaxx() / 2, getmaxy() / 2, "You are in graphics mode now...");
  16.   outtextxy(getmaxx()/2, getmaxy() - 50, "Press any key to switch to text mode");
  17.   getch();
  18. /* Switch to text mode */
  19.   restorecrtmode();
  20.   gotoxy(20,1);
  21.   cputs("Press any key to return to graphics mode...");
  22.   getch();
  23. /* Back to graphics mode again */
  24.   setgraphmode(graphmode);
  25.   outtextxy( 10, getmaxy() / 2, "Graphics mode again. Notice everything's reset.");
  26.   outtextxy(getmaxx()/2, getmaxy() - 50, "Press any key to exit:");
  27.   getch();        /* Wait until a key is pressed */
  28.   closegraph();         /* Exit graphics library */
  29.   }